[XEN] Fix memory allocator after recent bootmem change.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 14 Dec 2006 15:43:40 +0000 (15:43 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 14 Dec 2006 15:43:40 +0000 (15:43 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/common/page_alloc.c

index 4365675a313e2ffd3b66034a7d96687ec0210c1c..89cc140cf16c8cbf6bd5f2440043db598d7d7ba3 100644 (file)
@@ -295,7 +295,7 @@ static DEFINE_SPINLOCK(heap_lock);
 void end_boot_allocator(void)
 {
     unsigned long i, j, k;
-    int curr_free = 0, next_free = 0;
+    int curr_free, next_free;
 
     memset(avail, 0, sizeof(avail));
 
@@ -305,6 +305,8 @@ void end_boot_allocator(void)
                 INIT_LIST_HEAD(&heap[i][j][k]);
 
     /* Pages that are free now go to the domain sub-allocator. */
+    if ( (curr_free = next_free = !allocated_in_map(first_valid_mfn)) )
+        map_alloc(first_valid_mfn, 1);
     for ( i = first_valid_mfn; i < max_page; i++ )
     {
         curr_free = next_free;